package com.wsl.Entity;



import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;


/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 22:23 2017/11/28
 * @Modified by:
 */
@Entity
@NamedQuery(name="Person.withNameAndAddressNamedQuery",query="select p from Person p where p.name=?1 and p.address=?2")
public class Person {
    @Id //注意注解的引用 引用错了 导致启动不起来   @Id 数据库的主键
    @GeneratedValue//@GeneratedValue默认使用主键生成方式为自增
    private Long id;
    private  String name;
    private Integer age;
    private String address;

    public Person() {
    }

    public Person(Integer id,String name, Integer age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
